package basic;

import java.util.Random;
import java.util.Scanner;

public class Day0607 {
  public static void main(String[] args){
      /*
        my first programming  in this year
       */
//      Scanner sc=new Scanner(System.in);
      String sy= "you must be happy !";//sc.next();
      System.out.println(sy+" all rainning weekend !");

      //数据类型，byte short int long float double boolean char

      int i=10;
      int j=20;
      int k=10;
      boolean result01=(i>j)&&(i==k);//false
      System.out.println("result01= "+result01);
      boolean result02=(i>j)||(i==k);//true
      System.out.println("result02= "+result02);
      boolean result03=(i>j)^(i==k);//false^true
      System.out.println("result03= "+result03);//true
      boolean result04=!(i>j);//true
      System.out.println("result04= "+result04);


      System.out.println("*******************************************");
      boolean result05=(++i<100)||(++j>10);
      System.out.println("result05= "+result05);
      System.out.println("i= "+i);
      System.out.println("j= "+j);

      System.out.println("*****************三元表达式**************************");
      int max=i>j?i:j;
      String s=i>j?"及格":"不及格";
      System.out.println("max= "+max);

      System.out.println("*****************Scanner输入**************************");
      Scanner sc=new Scanner(System.in);
      try {
          String s1=sc.next();
          int i1=sc.nextInt();
          System.out.println("s1= " + s1 + " i1= " + i1);
      }catch (Exception e){
          e.printStackTrace();
      }finally {
          System.out.println("你输入数据类型错误！！！");
      }

      System.out.println("*********************指定范围内随机一个属*****************");
      //创建对象
      Random rd=new Random();

      //在1-100之间随机
      int data1= rd.nextInt(100)+1;
      System.out.println("data1= "+data1);

      //在100-999之间随机一个数
      int data2= rd.nextInt(900)+100;
      System.out.println("data2= "+data2);

  }

}
